/*
 * @Descripttion:
 * @version:
 * @Author: sueRimn
 * @Date: 2020-10-21 18:10:42
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-11-14 16:59:03
 * 文档地址：http://lz.25002.cn/msmcenter_api/index.php
 */
import request from '@/utils/request'
import store from '@/store/index'
const base = require('../../env/index')

// 夹带k_token
function addK_Token(data) {
    var token = {
        k_token: store.getters.k_token
    }
    Object.assign(data, token)
    return data
}

/**
 * 查询教室列表
 */
export function searchClassRoom(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/classroom/list',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 查询学生列表
 */
export function getstu(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/classroom/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 查询教材
 */
export function searchJiaocaiID(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/textbook/getInfos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

/**
// 查询学期
 */
export function searchSemeter(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/pay/lession/semesterList',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
 * 班级数据
 **/
// 添加班级
export function addClass(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/save',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 分页获取班级信息
export function searchClass(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/infos',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 获取课程
export function searchCourse(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/lession/list/',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 获取老师信息
export function getTeacherAPI(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/teacher/list/',
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 获取教室空闲时间信息
export function chajiaoshikongjianshijian(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/freetime/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

// 获取班级信息
export function editClass(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/clbum/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}

// 删除班级信息
export function deleteClassById(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/classr/delete/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
/**
*时间表名字
**/
// 时间列表
export function getTimeTable(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/timetable/infos/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}
// 获取作息时间段
export function getShijianduan(data) {
    return request({
        url: base.classmanagement_url + '/api/v1/admin/timetable/info/' + data.unid,
        method: 'POST',
        headers: {},
        data: addK_Token(data)
    })
}